package com.member.shop.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.member.common.annotation.Log;
import com.member.shop.domain.SysBizGoods;
import com.member.shop.domain.SysBizGoodsSku;
import com.member.shop.domain.SysBizUser;
import com.member.shop.dto.GoodsQueryDto;
import com.member.shop.dto.SysBizGoodsDto;
import com.member.shop.vo.GoodsDetailVo;
import com.member.shop.vo.GoodsIndexVo;

import java.util.HashMap;
import java.util.List;

/**
 * 商品Service接口
 *
 * @author lixinchen
 * @date 2024-01-05
 */
public interface ISysBizGoodsService extends IService<SysBizGoods> {
    /**
     * 查询商品
     *
     * @param id 商品主键
     * @return 商品
     */
    public SysBizGoods selectSysBizGoodsById(Long id);

    /**
     * 查询商品列表
     *
     * @param queryWrapper 商品
     * @return 商品集合
     */
    public List<SysBizGoods> selectSysBizGoodsList(LambdaQueryWrapper<SysBizGoods> queryWrapper);


    /**
     * 新增商品
     *
     * @param sysBizGoods 商品
     * @return 结果
     */
    public int insertSysBizGoods(SysBizGoods sysBizGoods);

    /**
     * 修改商品
     *
     * @param sysBizGoods 商品
     * @return 结果
     */
    public int updateSysBizGoods(SysBizGoods sysBizGoods);

    /**
     * 批量删除商品
     *
     * @param ids 需要删除的商品主键集合
     * @return 结果
     */
    public int deleteSysBizGoodsByIds(Long[] ids);

    /**
     * 删除商品信息
     *
     * @param id 商品主键
     * @return 结果
     */
    public int deleteSysBizGoodsById(Long id);

    /**
     * 查询商品列表
     *
     * @param sysBizGoods 商品
     * @return 商品集合
     */
    List<SysBizGoodsDto> selectSysBizGoodsList(SysBizGoods sysBizGoods);

    List<GoodsIndexVo> selectSysBizGoods(GoodsQueryDto goodsQueryDto, List<Long> ids);

    List<GoodsIndexVo> selectSysBizGoodsByIds(GoodsQueryDto goodsQueryDto, List<Long> ids);

    List<GoodsIndexVo> selectSysBizGoodsByIds2(GoodsQueryDto goodsQueryDto, List<Long> ids, Long tenantId, Long userId);

    List<GoodsIndexVo> selectSysBizGoodsBySkuId(GoodsQueryDto goodsQueryDto, List<SysBizGoodsSku> skuList, Long userId);

    GoodsDetailVo queryGoodsDetail(Long id, Long userId,Long tenantId);

    boolean hasCategory(Long id);

    void lockSales(Long goodsId, Long number);

    void setOperationTag(GoodsQueryDto goodsQueryDto, List<GoodsIndexVo> goodsIndexVoList);

    List<SysBizGoods> getGoodsList(GoodsQueryDto goodsQueryDto, HashMap<String, String> wordMap);

    int lockStocks(Long id, Long number);

    void releaseStocks(Long id, Long number);
}

